@extends('public')

@section('link')
    <link rel="stylesheet" href="/css/user.css">
@endsection

@section('module' , 'User')

@section('content')
    <div class="content">
        <div class="warp">
            <ul>
                @foreach($data as $value)
                    <li>
                        <form action="/Module_C/userReason" method="post">
                            <p><a href="@yield('host')user/:{{$value['username']}}">{{$value['username']}}</a></p>
                            <p>Created in {{$value['created_at']}}</p>
                            @if($value['reason'] == null)
                            <input type="submit" name="reason" value="Disable">
                            <select name="cause" id="">
                                <option value="You have been blocked by an administrator">“You have been blocked by an administrator”</option>
                                <option value="You have been blocked for spammin">“You have been blocked for spammin</option>
                                <option value="You have been blocked for cheating">“You have been blocked for cheating”</option>
                            </select>
                            @else
                                <input type="submit" value="Enable" name="reason">
                            @endif
                            <p class="last">Last login {{date('Y-m-d' , $value['last_login_timestamp'])}}</p>
                            <input type="hidden" value="{{$value['id']}}" name="id">
                            @method('PUT')
                            @csrf
                        </form>
                    </li>
                @endforeach
            </ul>
        </div>
    </div>
@endsection
